<?php
/**
 * Created by PhpStorm.
 * User: 小蛮哼哼哼
 * Email: 243194993@qq.com
 * Date: 2021/11/11
 * Time: 14:02
 * motto: 现在的努力是为了小时候吹过的牛逼！
 */

declare(strict_types=1);

namespace app\common\validate;

class Menu extends Base
{
    protected $rule = [
        "pid" => "require",
        "title" => "require",
        "type" => "require|in:0,1",
        "controller" => "alpha",
        "action" => "alpha",
        "target" => "require",
        "remark" => "max:200"
    ];
    protected $message = [
        "pid.require" => "请选择菜单等级",
        "title.require" => "请输入菜单名称",
        "type.require" => "请选择类型",
        "type.in" => "类型选择错误",
        "controller.require" => "请输入控制器",
        "controller.alpha" => "控制器只能全为英文字母",
        "action.require" => "请输入方法",
        "action.alpha" => "方法只能为英文字母",
        "target.require" => "请选择target属性",
        "remark.max" => "备注信息太长"
    ];
    protected $scene = [
        "add" => ["parent_id", "title", "type", "controller", "action", "target", "remark"]
    ];
}